package com.lty.jeeg.server.modules.fas.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.lty.jeeg.server.common.enums.CodeEnum;
import com.lty.jeeg.server.modules.sys.model.BaseEntity;
import lombok.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author : ZL
 * @date : 2019-02-13 10:41:31
 * Description : 需求单
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Order extends BaseEntity<Long> {

    private static final long serialVersionUID = 1L;
	/**
	 需求单编码
	  */
	private String name;

	/** 
	 发起人id
	  */
	private Long originatorId;

	/** 
	 发起人姓名
	  */
	private String originatorName;

	/** 
	 状态
	  */
	private Integer orderType;

	@Getter
	@NoArgsConstructor
	@AllArgsConstructor
	public enum OrderType implements CodeEnum<Integer> {
		/**
		 *
		 */
		DRAFT(0, "待提交"),
		TO_BE_CONFIRMED(1, "待确认"),
		TO_BE_DELIVERED(2, "待交付"),
		PARTIAL_DELIVERY(3, "部分交付"),
		DELIVERED(4, "全部交付"),
		;


		private Integer code;

		private String msg;
	}

	/** 
	 发起人所在部门id
	  */
	private Long originatorOfficeId;

	/** 
	 发起人所在部门名称
	  */
	private String originatorOfficeName;

	/** 
	 公司id
	  */
	private String companyId;

	/** 
	 公司名称
	  */
	private String companyName;

	/** 
	 期望交付日期
	  */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date wishPayDate;

	/**
	 采购单总价
	  */
	private BigDecimal totalPrice;

	/** 
	 交付完成日期
	  */
	private Date deliveryDate;

	/** 
	 截图附件
	  */
	private String screenshotPath;


    private List<OrderDetail> orderDetailList = Lists.newArrayList();



}
